﻿$(function () {
    $('#activity').click(function () {
        AjaxSave();
    });
});
function GetValues() {
    var obj = {};
    obj.name = $('#name').val();
    obj.sex = $('#sex').val();
    obj.mobile = $('#mobile').val();
    obj.cardno = $('#cardno').val();
    obj.bloodType = $('#bloodType').val();
    obj.illnesshistory = $('#illnesshistory').val();
    obj.emergencycontact = $('#emergencycontact').val();
    obj.emergencycontactmobile = $('#emergencycontactmobile').val();
    obj.policynumber = $('#policynumber').val();
    obj.company = $('#company').val();
    obj.insureanceAgent = $('#insureanceAgent').val();
    obj.numberplate = $('#numberplate').val();
    obj.VIN = $('#VIN').val();
    obj.driving = $('#driving').val();
    obj.card = $('#card').val();
    obj.password = $('#password').val();
    return obj;
}
function AjaxSave() {
    var obj = GetValues();
    var check = document.getElementById('agree');
    if (check.checked == false) {
        alert("请先同意正航兴救救援协议");
        return;
    }
    $.ajax({
        url: 'ActivityZHXJ',
        data: { "json": JSON.stringify(obj) },
        method: 'POST',
        success: function (result) {
            result = eval('(' + result + ')');
            alert(result.Message);
            if (result.IsSucceed) {
                window.location.href = "ActivityIndex?typs=1";
            }
        }
    });
}

function HrefToGlobal() {
    localStorage.obj =JSON.stringify( GetValues());
    window.location.href = "UPToGlobal";
}